<!-- 1：1万地层-面 -->
<template>
    <el-drawer v-model="addDrawer" size="45%" :show-close="false" @opened="openDrawer" @close="closeDrawer">
        <template #title>
            <h2><svg-icon icon-class="list"></svg-icon><span style="padding-left: 15px">{{ typeName }}</span></h2>
            <el-button type="primary" @click="confirmClick" :disabled="drawerLoading" v-if="isShowSave">保存</el-button>
        </template>
        <template #default>
            <el-form :model="form" ref="addRef" :inline="true" :rules="formRules" label-width="140px"
                v-loading="drawerLoading">
                <el-row justify="space-between">
                    <el-form-item label="省">
                        <el-input v-model="form.province" clearable disabled></el-input>
                    </el-form-item>
                    <el-form-item label="市">
                        <el-input v-model="form.city" clearable disabled></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="区/县">
                        <el-input v-model="form.county" clearable disabled></el-input>
                    </el-form-item>
                    <el-form-item label="地层编号" prop="id">
                        <el-input v-model="form.id" placeholder="请输入地层编号" clearable maxlength="17"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="地层名称" prop="deformationBeltName">
                        <el-input v-model="form.deformationBeltName" placeholder="请输入地层名称" clearable maxlength="40"></el-input>
                    </el-form-item>
                    <el-form-item label="地层年代" prop="symbol">
                        <dict-select code="StratigraphyCVD" :value="form.symbol" @update="val => form.symbol = val"></dict-select>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="沉积相（符号）" prop="sedimentaryFacies">
                        <el-input v-model="form.sedimentaryFacies" placeholder="请输入沉积相（符号）" clearable maxlength="20"></el-input>
                    </el-form-item>
                    <el-form-item label="地层厚度 [米]" prop="thickness">
                        <el-input v-model="form.thickness" placeholder="请输入沉积相（符号）" clearable maxlength="40"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="地层描述" prop="description" style="width:100%">
                        <el-input v-model="form.description" placeholder="请输入地层描述" :autosize="{ minRows: 6, maxRows: 12 }"
                            type="textarea" show-word-limit maxlength="2147483647" clearable></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="合并地层名称" prop="unionName" style="width:100%">
                        <el-input v-model="form.unionName" placeholder="请输入合并地层名称" clearable maxlength="50"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="地层符号基础位" prop="symbolMain" style="width:100%">
                        <el-input v-model="form.symbolMain" placeholder="请输入地层符号基础位" :autosize="{ minRows: 3, maxRows: 6 }"
                            type="textarea" show-word-limit maxlength="200" clearable></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="符号上标" prop="symbolUp">
                        <el-input v-model="form.symbolUp" placeholder="请输入符号上标" clearable maxlength="20"></el-input>
                    </el-form-item>
                    <el-form-item label="符号下标" prop="symbolLow">
                        <el-input v-model="form.symbolLow" placeholder="请输入符号下标" clearable maxlength="20"></el-input>
                    </el-form-item>
                </el-row>
                <el-row justify="space-between">
                    <el-form-item label="备注" prop="commentInfo" style="width:100%">
                        <el-input v-model="form.commentInfo" placeholder="请输入备注" :autosize="{ minRows: 6, maxRows: 12 }"
                            type="textarea" show-word-limit maxlength="2147483647" clearable></el-input>
                    </el-form-item>
                </el-row>
            </el-form>
        </template>
    </el-drawer>
</template>
<script setup>
// 引入基础方法
import useSpatialData from '@/hooks/useSpatialData';
// 引入表单验证规则
import { eightDouble, fourInt } from '@/utils/validate';
const { route, addDrawer, drawerLoading, form, typeName, openDrawer, closeDrawer, confirmClick, isShowSave } = useSpatialData();
// 表单验证规则
const formRules = {
    id: [{ required: true, message: '请输入地层编号！', trigger: 'blur' }],
    deformationBeltName: [{ required: true, message: '请输入地层名称', trigger: 'blur' }],
}
</script>
<style lang="scss" scoped></style>